import os

# 定义文件夹路径
folder_path = r'D:\gitee\fish-xxl\assets\textures'

# 定义重命名映射
rename_map = {
    "Back Icon.png": "back_icon.png",
    "Bear Eyes Closed.png": "bear_eyes_closed.png",
    "Bear Eyes Open.png": "bear_eyes_open.png",
    "Bird Eyes Closed.png": "bird_eyes_closed.png",
    "Bird Eyes Open.png": "bird_eyes_open.png",
    "Blue Button.png": "blue_button.png",
    "Blue Cat Eyes Closed.png": "blue_cat_eyes_closed.png",
    "Blue Cat Eyes Open.png": "blue_cat_eyes_open.png",
    "Blue Rabbit.png": "blue_rabbit.png",
    "Blue Pink Stripes Cat.png": "blue_pink_stripes_cat.png",
    "Bubble Cat Booster.png": "bubble_cat_booster.png",
    "BUBble Cat.png": "bubble_cat.png",
    "Choco Block.png": "choco_block.png",
    "Color Candy Booster.png": "color_candy_booster.png",
    "Color Candy.png": "color_candy.png",
    "Cross Shooter Booster.png": "cross_shooter_booster.png",
    "Fox Eyes Closed.png": "fox_eyes_closed.png",
    "Fox Eyes Open.png": "fox_eyes_open.png",
    "Frog Eyes Closed.png": "frog_eyes_closed.png",
    "Frog Eyes Open.png": "frog_eyes_open.png",
    "Frozen Bubble Block.png": "frozen_bubble_block.png",
    "Ice Block.png": "ice_block.png",
    "Koala Bear.png": "koala_bear.png",
    "Owl.png": "owl.png",
    "Panda Bear.png": "panda_bear.png",
    "Pig Eyes Closed.png": "pig_eyes_closed.png",
    "Pig Eyes Open.png": "pig_eyes_open.png",
    "Pink Button.png": "pink_button.png",
    "Pink Rabbit.png": "pink_rabbit.png",
    "Shine1.png": "shine1.png",
    "Shine2.png": "shine2.png",
    "Shine3.png": "shine3.png",
    "Tiger Cat.png": "tiger_cat.png",
    "Time Booster.png": "time_booster.png",
    "White Rabbit Eyes Open.png": "white_rabbit_eyes_open.png",
    "White Rabbit Eyes Closed.png": "white_rabbit_eyes_closed.png",
    "Wood Block.png": "wood_block.png",
}

# 遍历文件夹并重命名文件
for old_name, new_name in rename_map.items():
    old_file_path = os.path.join(folder_path, old_name)
    new_file_path = os.path.join(folder_path, new_name)
    
    print(f'Checking: {old_file_path}')
    if os.path.exists(old_file_path):
        try:
            os.rename(old_file_path, new_file_path)
            print(f'Renamed: {old_name} to {new_name}')
        except Exception as e:
            print(f'Error renaming {old_name} to {new_name}: {e}')
    else:
        print(f'File not found: {old_name}')